package com.ftg.mall.controller.pms;

import com.ftg.mall.base.entity.pms.Product;
import com.ftg.mall.base.entity.pms.SkuStock;
import com.ftg.mall.base.util.bussiness.AbstractController;
import com.ftg.mall.base.util.tooltips.ResBean;
import com.ftg.mall.service.impl.pms.SkuStockServiceImpl;
import com.ftg.mall.service.pms.IProductCategoryService;
import com.ftg.mall.service.pms.ISkuStockService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import org.springframework.web.bind.annotation.*;
import org.springframework.stereotype.Controller;

import javax.annotation.Resource;
import java.util.List;

/**
 * <p>
 * sku的库存 前端控制器
 * </p>
 *
 * @author wangty
 * @since 2022-11-17
 */
@Controller
@RequestMapping("/pms/skuStock")
@Api(tags = "sku的库存")
public class SkuStockController extends AbstractController<SkuStockServiceImpl, SkuStock> {


    @Resource
    ISkuStockService iSkuStockService;



    /**
     * 添加库存，库存预警
     * @param
     * @return
     */
    @PostMapping("/insertSku")
    @ApiOperation("添加库存-库存预警")
    public List<SkuStock> insertSku(
            @RequestBody  SkuStock skuStock ,
            @RequestParam("product_id")@ApiParam("商品编号") Long productId)
    {
        return iSkuStockService.insertSku(skuStock,productId);
    }
}
